package org.example.service;

import org.example.annotation.*;
import org.example.spring.BeanNameAware;
import org.example.spring.InitializingBean;

/**
 * @description：
 * @author：dxs
 * @date：2024/4/2 09:27
 */
@Component(value = "userService")
@Scope(value = "singleton")
public class UserServiceImpl implements BeanNameAware, InitializingBean {
    @Autowired
    private OrderServiceImpl orderServiceImpl;

    private String beanName;
    public UserServiceImpl() {
    }

    public OrderServiceImpl getOrderServiceImpl() {
        return orderServiceImpl;
    }

    public void setOrderServiceImpl(OrderServiceImpl orderServiceImpl) {
        this.orderServiceImpl = orderServiceImpl;
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }
    public String getBeanName() {
        return beanName;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("UserServiceImpl afterPropertiesSet");
    }
}
